home *** CD-ROM | disk | FTP | other *** search
- on swapme
- global myclick, cx, cy, total
- set myclick to the clickOn
- set cx to the locH of sprite the clickOn
- set cy to the locV of sprite the clickOn
- if (the clickOn < 21) and (the clickOn > 10) then
- set the castNum of sprite 33 to the castNum of sprite the clickOn
- set the locV of sprite myclick to -200
- moveme()
- if sprite 33 within 3 then
- set the locH of sprite myclick to the locH of sprite 33
- set the locV of sprite myclick to the locV of sprite 33
- set the locV of sprite 33 to -200
- set total to total + 1
- else
- if sprite 33 intersects 3 and not (sprite 33 within 3) then
- smove(33, 30, cx, cy)
- set the locH of sprite myclick to cx
- set the locV of sprite myclick to cy
- set the locV of sprite 33 to -200
- else
- set the locH of sprite myclick to the mouseH
- set the locV of sprite myclick to the mouseV
- set the locV of sprite 33 to -200
- updateStage()
- end if
- end if
- end if
- end
-
- on swapme2
- global myclick, cx, cy, mysound, bugsounds
- set myclick to the clickOn
- set cx to the locH of sprite the clickOn
- set cy to the locV of sprite the clickOn
- if (the clickOn < 21) and (the clickOn > 10) then
- set the castNum of sprite 33 to the castNum of sprite the clickOn
- set the locH of sprite 33 to cx
- set the locV of sprite 33 to cy
- set the locV of sprite myclick to -200
- set mysound to getAt(bugsounds, myclick - 10)
- end if
- end
-
- on moveme2
- global myclick, cx, cy, total, toplimit, bottomlimit, rightlimit, leftlimit, bugstatus, stopbugs, gobugs, athome
- set loch33 to the locH of sprite 33
- set locv33 to the locV of sprite 33
- if sprite 33 intersects 48 then
- smove(33, 30, cx, cy)
- set the locH of sprite myclick to cx
- set the locV of sprite myclick to cy
- set the locV of sprite 33 to -200
- else
- if sprite 3 intersects 33 then
- set the locH of sprite myclick to loch33
- set the locV of sprite myclick to locv33
- set the castNum of sprite myclick to getAt(stopbugs, myclick - 10)
- setAt(bugstatus, myclick - 10, 1)
- set the locV of sprite 33 to -200
- set total to total + 1
- sortthem()
- else
- set the locH of sprite myclick to loch33
- set the locV of sprite myclick to locv33
- set the castNum of sprite myclick to getAt(gobugs, myclick - 10)
- setAt(bugstatus, myclick - 10, 0)
- set the locV of sprite 33 to -200
- if getPos(athome, myclick) > 0 then
- deleteAt(athome, getPos(athome, myclick))
- end if
- sortthem()
- end if
- end if
- puppetSound(0)
- go("presto")
- end
-
- on nextnum
- global numberlist
- if numberlist = [] then
- set templist to [1, 2, 3, 4, 5, 6, 7, 8, 9, 10]
- set numberlist to []
- repeat with xxx = 1 to 10
- set holdme to getAt(templist, random(count(templist)))
- add(numberlist, holdme)
- deleteAt(templist, getPos(templist, holdme))
- end repeat
- end if
- set wnum to getAt(numberlist, random(count(numberlist)))
- deleteAt(numberlist, getPos(numberlist, wnum))
- return wnum
- end
-
- on correctbugs
- global bugstatus, gametwolevel, wnum, bugcount, origcoord, boxcenter, boxgrid, gobugs, stopbugs
- set boxbot to the bottom of sprite 3
- set boxtop to the top of sprite 3
- set boxleft to the left of sprite 3
- set boxright to the right of sprite 3
- set totbugs to 0
- repeat with xxx = 1 to 10
- if getAt(bugstatus, xxx) = 1 then
- set totbugs to totbugs + 1
- end if
- end repeat
- if bugcount = "lessthan" then
- set xxx to 1
- repeat while totbugs < wnum
- if getAt(bugstatus, xxx) = 0 then
- set thissprite to xxx + 10
- set changeh to (getAt(getAt(boxgrid, xxx), 1) - the locH of sprite thissprite) / 5.0
- set changev to (getAt(getAt(boxgrid, xxx), 2) - the locV of sprite thissprite) / 5.0
- repeat with yyy = 1 to 5
- set the locH of sprite thissprite to the locH of sprite thissprite + changeh
- set the locV of sprite thissprite to the locV of sprite thissprite + changev
- updateStage()
- end repeat
- set the castNum of sprite thissprite to getAt(stopbugs, thissprite - 10)
- set the locH of sprite thissprite to getAt(getAt(boxgrid, xxx), 1)
- set the locV of sprite thissprite to getAt(getAt(boxgrid, xxx), 2)
- set myl to boxleft - the left of sprite thissprite
- set myt to boxtop - the top of sprite thissprite
- set myr to the right of sprite thissprite - boxright
- set myb to the bottom of sprite thissprite - boxbot
- if not (sprite thissprite within 3) then
- if 0 <= myl then
- set the locH of sprite thissprite to the locH of sprite thissprite + (myl + 10)
- end if
- if 0 <= myt then
- set the locV of sprite thissprite to the locV of sprite thissprite + (myt + 10)
- end if
- if 0 <= myr then
- set the locH of sprite thissprite to the locH of sprite thissprite - (myr + 10)
- end if
- if 0 <= myb then
- set the locV of sprite thissprite to the locV of sprite thissprite - (myb + 10)
- end if
- updateStage()
- end if
- setAt(bugstatus, xxx, 1)
- set totbugs to totbugs + 1
- end if
- set xxx to xxx + 1
- end repeat
- sortthem()
- else
- set xxx to 1
- repeat while totbugs > wnum
- if getAt(bugstatus, xxx) = 1 then
- set thissprite to xxx + 10
- set changeh to (getAt(getAt(origcoord, xxx), 1) - the locH of sprite thissprite) / 5
- set changev to (getAt(getAt(origcoord, xxx), 2) - the locV of sprite thissprite) / 5
- repeat with yyy = 1 to 5
- set the locH of sprite thissprite to the locH of sprite thissprite + changeh
- set the locV of sprite thissprite to the locV of sprite thissprite + changev
- updateStage()
- end repeat
- set the castNum of sprite thissprite to getAt(gobugs, thissprite - 10)
- setAt(bugstatus, xxx, 0)
- set totbugs to totbugs - 1
- end if
- set xxx to xxx + 1
- end repeat
- end if
- end
-
- on bugsetup
- global wnum, TRIAL, total, numberlist, gametwolevel, direction, rightsprite, gobugs, stopbugs, numbercast, rednumcast, panelcast, bfcast, bgcast, gocast, stopcast, saybottombox, dupnumbers, bugsounds, athome
- set total to 0
- set TRIAL to 0
- set athome to []
- set rightsprite to 0
- if gametwolevel = 1 then
- puppetSprite(42, 1)
- set wnum to nextnum()
- if wnum = 1 then
- set the castNum of sprite 42 to getAt(panelcast, 2)
- else
- set the castNum of sprite 42 to getAt(panelcast, 1)
- end if
- set saybottombox to "put " & wnum
- puppetSprite(47, 1)
- set the castNum of sprite 47 to getAt(numbercast, wnum + 1)
- set the locH of sprite 47 to 254
- else
- if gametwolevel = 2 then
- set direction to 2
- if random(100) > 50 then
- set wnum to nextnum()
- set othernum to nextnum()
- repeat while wnum = othernum
- set othernum to nextnum()
- end repeat
- puppetSprite(42, 1)
- set the castNum of sprite 42 to getAt(panelcast, 4)
- puppetSprite(45, 1)
- set the locH of sprite 45 to 495
- set the castNum of sprite 45 to getAt(dupnumbers, wnum * 2)
- puppetSprite(46, 1)
- set the locH of sprite 46 to 495
- set the castNum of sprite 46 to getAt(dupnumbers, (othernum * 2) - 1)
- puppetSprite(47, 1)
- set the locH of sprite 47 to 595
- set the castNum of sprite 47 to 26
- set saybottombox to "Level 2.2 What's Next"
- else
- set direction to 1
- set wnum to nextnum()
- repeat while wnum = 10
- set wnum to nextnum()
- end repeat
- puppetSprite(42, 1)
- set the castNum of sprite 42 to getAt(panelcast, 3)
- puppetSprite(45, 1)
- set the locH of sprite 45 to 379
- set the castNum of sprite 45 to getAt(numbercast, wnum)
- puppetSprite(46, 1)
- set the locH of sprite 46 to 465
- set the castNum of sprite 46 to getAt(numbercast, wnum + 2)
- puppetSprite(47, 1)
- set the locH of sprite 47 to 422
- set the castNum of sprite 47 to 26
- set saybottombox to "Level 2.1 What's missing"
- end if
- else
- if gametwolevel = 3 then
- set lev3list to []
- if random(100) > 50 then
- set numofchoices to 3
- set suffix to "est"
- else
- set numofchoices to 2
- set suffix to "er"
- end if
- repeat with xxx = 1 to numofchoices
- set zoome to nextnum()
- if not (getPos(lev3list, zoome) = 0) then
- repeat while not (getPos(lev3list, zoome) = 0)
- set zoome to nextnum()
- end repeat
- end if
- add(lev3list, zoome)
- end repeat
- if random(100) > 50 then
- set direction to "small" & suffix
- set wnum to min(lev3list)
- puppetSprite(42, 1)
- set the castNum of sprite 42 to getAt(panelcast, 5 + numofchoices)
- else
- set direction to "larg" & suffix
- set wnum to max(lev3list)
- puppetSprite(42, 1)
- set the castNum of sprite 42 to getAt(panelcast, 3 + numofchoices)
- end if
- set saybottombox to "Level 3 Put " & direction
- set rightsprite to 44 + getPos(lev3list, wnum)
- if numofchoices = 2 then
- puppetSprite(45, 1)
- set the castNum of sprite 45 to getAt(numbercast, getAt(lev3list, 1) + 1)
- set the locH of sprite 45 to 515
- puppetSprite(46, 1)
- set the castNum of sprite 46 to getAt(numbercast, getAt(lev3list, 2) + 1)
- set the locH of sprite 46 to 589
- puppetSprite(47, 0)
- else
- puppetSprite(45, 1)
- set the castNum of sprite 45 to getAt(numbercast, getAt(lev3list, 1) + 1)
- set the locH of sprite 45 to 505
- puppetSprite(46, 1)
- set the castNum of sprite 46 to getAt(numbercast, getAt(lev3list, 2) + 1)
- set the locH of sprite 46 to 599
- puppetSprite(47, 1)
- set the castNum of sprite 47 to getAt(numbercast, getAt(lev3list, 3) + 1)
- set the locH of sprite 47 to 552
- end if
- end if
- end if
- end if
- set gobugs to []
- set stopbugs to []
- set bugsounds to []
- puppetSprite(33, 1)
- repeat with bugs = 11 to 20
- if bugs < 16 then
- set meme to random(5)
- set dacast to getAt(bgcast, meme)
- add(bugsounds, "walk" & meme)
- else
- set meme to random(8)
- set dacast to getAt(bfcast, meme)
- add(bugsounds, "fly" & meme)
- end if
- add(gobugs, dacast)
- add(stopbugs, getAt(stopcast, getPos(gocast, dacast)))
- puppetSprite(bugs, 1)
- set the castNum of sprite bugs to dacast
- set the visible of sprite bugs to 1
- end repeat
- end
-
- on showspit
- global bugstatus
- set dalist to []
- repeat with xxx = 11 to 20
- add(dalist, list(the locH of sprite xxx, the locV of sprite xxx))
- end repeat
- put dalist
- end
-
- on countbugs
- global bugstatus, mysound
- set mylist to []
- repeat with xxx = 1 to 10
- if getAt(bugstatus, xxx) = 1 then
- add(mylist, 1000 + the locV of sprite (xxx + 10) & "," & 1000 + the locH of sprite (xxx + 10) & "," & xxx + 10)
- end if
- end repeat
- sort(mylist)
- set limit to count(mylist)
- repeat with xxx = 1 to limit
- set dasprite to value(item 3 of getAt(mylist, xxx))
- set holdbcol to the backColor of sprite dasprite
- set holdfcol to the foreColor of sprite dasprite
- set holdink to the ink of sprite dasprite
- set the ink of sprite dasprite to 8
- set the foreColor of sprite dasprite to 215
- set the backColor of sprite dasprite to 255
- set mysound to "say" & xxx
- play frame "play audio"
- set the backColor of sprite dasprite to holdbcol
- set the foreColor of sprite dasprite to holdfcol
- set the ink of sprite dasprite to holdink
- end repeat
- updateStage()
- end
-
- on flashme
- global gametwolevel
- if gametwolevel = 2 then
- set holdvis to the visible of sprite 47
- set holdvis to not holdvis
- put holdvis
- set the visible of sprite 47 to holdvis
- end if
- end
-
- on getbugsound
- global bugsounds
- if bugsounds = [] then
- set bugsounds to ["spin/wb10", "bees1", "cricket"]
- end if
- set mybug to getAt(bugsounds, random(count(bugsounds)))
- deleteAt(bugsounds, getPos(bugsounds, mybug))
- return mybug
- end
-